package com.vstudy.web.bootstrap;


import com.vstudy.web.annotation.FirstLevelRepository;
import com.vstudy.web.repository.MyRepository;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = {"com.vstudy.web.repository"})
public class FirstLevelBootstrap {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder(FirstLevelBootstrap.class)
                .web(WebApplicationType.NONE)
                .run(args);
        MyRepository myRepository = (MyRepository) context.getBean("myRepository");
        myRepository.show();
        context.close();
    }
}
